﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" 
    xmlns:controlsPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls" 
    x:Class="PhoneInfo.Page.SearchResult"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    shell:SystemTray.IsVisible="false"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    xmlns:local="clr-namespace:PhoneInfo"
    xmlns:delay="clr-namespace:Delay;assembly=PhonePerformance" toolkit:TiltEffect.IsTiltEnabled="True" 
    Loaded="PhoneApplicationPage_Loaded" Style="{StaticResource TransitionPageStyle}"
    >
   
	<phone:PhoneApplicationPage.Resources>
        <local:FixEmptyUrl x:Key="FixUrl"/>
        <local:BoolToVis   x:Key="BoolToVis"/>
        <Style x:Key="PivotStyle1" TargetType="controls:Pivot">
			<Setter Property="Margin" Value="0"/>
			<Setter Property="Padding" Value="0"/>
			<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="ItemsPanel">
				<Setter.Value>
					<ItemsPanelTemplate>
						<Grid/>
					</ItemsPanelTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="controls:Pivot">
						<Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="*"/>
							</Grid.RowDefinitions>
							<Grid Background="{TemplateBinding Background}" CacheMode="BitmapCache" Grid.RowSpan="3"/>
							<controlsPrimitives:PivotHeadersControl x:Name="HeadersListElement" Grid.Row="1"/>
							<ItemsPresenter x:Name="PivotItemPresenter" Margin="{TemplateBinding Padding}" Grid.Row="2"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</phone:PhoneApplicationPage.Resources>
	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
<!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot" Background="{Binding Source={StaticResource Theme}, Path=cuTheme.TextBrush}">
        <toolkit:PerformanceProgressBar   Foreground="Orange" x:Name="ProgBar" Visibility="Collapsed"  IsIndeterminate="True" Height="10" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0" Grid.ColumnSpan="2"  Width="480" />   
    	<controls:Pivot Title="pivot" Style="{StaticResource PivotStyle1}" SelectionChanged="Pivot_SelectionChanged" Margin="0,10,0,0" d:LayoutOverrides="GridBox">
    		<controls:PivotItem  x:Name="New" Margin="12,0">
                <controls:PivotItem.Header>
                    <TextBlock Text="最新"   Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.TitleBrush}"  FontSize="50" />
                </controls:PivotItem.Header>
                <ListBox ItemsSource="{Binding SearchResultItems}"  Tap="ListBox_Tap">
                    <toolkit:GestureService.GestureListener>
                        <toolkit:GestureListener  Flick="GestureListener_Flick"  />
                    </toolkit:GestureService.GestureListener>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="10">
                                <Grid Width="90" Height="110"  Margin="5" >
                                    <Image  HorizontalAlignment="Center" VerticalAlignment="Center"
                                            delay:LowProfileImageLoader.UriSource="{Binding Ponhe1_picurl, Converter={StaticResource FixUrl}}"  Stretch="Uniform" />
                                </Grid>
                                <StackPanel Orientation="Vertical" Width="309" Margin="10" >
                                    <StackPanel Height="40" Orientation="Horizontal">
                                        <TextBlock Text="{Binding Ponhe1_ppname}" Height="38" FontSize="26"
										          Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.SecondTextBrush}" />
                                        <TextBlock Text="{Binding Ponhe1_phonename}" Height="38" 
										           FontSize="26" Margin="10,0,0,0" 
												   Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.SecondTextBrush}" />
                                    </StackPanel>
                                    <StackPanel  Orientation="Horizontal" Margin="0,20,0,0">
                                        <TextBlock Text="价格:" Margin="5,0,0,0" Foreground="#5c83a8"  FontSize="20"/>
                                        <TextBlock Text="{Binding Ponhe1_price}"  Foreground="#5c83a8"  FontSize="20"/>
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PivotItem>
            <controls:PivotItem  x:Name="Hot" Margin="12,0">
                <controls:PivotItem.Header>
                    <TextBlock Text="最热"   Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.TitleBrush}"  FontSize="50" />
                </controls:PivotItem.Header>
            	<ListBox ItemsSource="{Binding SearchResultItems}" Tap="ListBox_Tap" Margin="0,0,0,60">
            		<toolkit:GestureService.GestureListener>
            			<toolkit:GestureListener Flick="GestureListener_Flick" />
            		</toolkit:GestureService.GestureListener>
            		<ListBox.ItemTemplate>
            			<DataTemplate>
            				 <StackPanel Orientation="Horizontal" Margin="10">
                                <Grid Width="90" Height="110"  Margin="5">
                                    <Image  HorizontalAlignment="Center"  VerticalAlignment="Center" 
                                            delay:LowProfileImageLoader.UriSource="{Binding Ponhe1_picurl, Converter={StaticResource FixUrl}}" 
                                            Stretch="Uniform" />
                                </Grid>
                                <StackPanel Orientation="Vertical" Width="309" Margin="10" >
                                    <StackPanel Height="40" Orientation="Horizontal">
                                        <TextBlock Text="{Binding Ponhe1_ppname}" Height="38" 
                                                   Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.SecondTextBrush}" FontSize="26"/>
                                        <TextBlock Text="{Binding Ponhe1_phonename}" Height="38" 
										           FontSize="26" Margin="10,0,0,0" 
                                                   Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.SecondTextBrush}"/>
                                    </StackPanel>
                                    <StackPanel  Orientation="Horizontal" Margin="0,20,0,0">
                                        <TextBlock Text="价格:" Margin="5,0,0,0" Foreground="#5c83a8"  FontSize="20"/>
                                        <TextBlock Text="{Binding Ponhe1_price}"  Foreground="#5c83a8"  FontSize="20"/>
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>
            			</DataTemplate>
            		</ListBox.ItemTemplate>
            	</ListBox>
            </controls:PivotItem>
    	</controls:Pivot>
    </Grid>

</phone:PhoneApplicationPage>
